Optimal. Leaf size=32 \[ a (A+B) x+\frac {a A \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a B \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {3047, 3102,
2814, 3855} \begin {gather*} a x (A+B)+\frac {a A \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a B \sin (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2814
Rule 3047
Rule 3102
Rule 3855
Rubi steps
\begin {align*} \int (a+a \cos (c+d x)) (A+B \cos (c+d x)) \sec (c+d x) \, dx &=\int \left (a A+(a A+a B) \cos (c+d x)+a B \cos ^2(c+d x)\right ) \sec (c+d x) \, dx\\ &=\frac {a B \sin (c+d x)}{d}+\int (a A+a (A+B) \cos (c+d x)) \sec (c+d x) \, dx\\ &=a (A+B) x+\frac {a B \sin (c+d x)}{d}+(a A) \int \sec (c+d x) \, dx\\ &=a (A+B) x+\frac {a A \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a B \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 46, normalized size = 1.44 \begin {gather*} a A x+a B x+\frac {a A \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a B \cos (d x) \sin (c)}{d}+\frac {a B \cos (c) \sin (d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 48, normalized size = 1.50
method | result | size |
derivativedivides | \(\frac {a A \left (d x +c \right )+a B \sin \left (d x +c \right )+a A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a B \left (d x +c \right )}{d}\) | \(48\) |
default | \(\frac {a A \left (d x +c \right )+a B \sin \left (d x +c \right )+a A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a B \left (d x +c \right )}{d}\) | \(48\) |
risch | \(a x A +a B x -\frac {i a B \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a B \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {a A \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {a A \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(83\) |
norman | \(\frac {\left (a A +a B \right ) x +\left (a A +a B \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 a A +2 a B \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {2 a B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 a B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {a A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(141\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 47, normalized size = 1.47 \begin {gather*} \frac {{\left (d x + c\right )} A a + {\left (d x + c\right )} B a + A a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + B a \sin \left (d x + c\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 51, normalized size = 1.59 \begin {gather*} \frac {2 \, {\left (A + B\right )} a d x + A a \log \left (\sin \left (d x + c\right ) + 1\right ) - A a \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, B a \sin \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int A \sec {\left (c + d x \right )}\, dx + \int A \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 79 vs.
\(2 (32) = 64\).
time = 0.45, size = 79, normalized size = 2.47 \begin {gather*} \frac {A a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - A a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + {\left (A a + B a\right )} {\left (d x + c\right )} + \frac {2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.28, size = 100, normalized size = 3.12 \begin {gather*} \frac {B\,a\,\sin \left (c+d\,x\right )}{d}+\frac {2\,A\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,A\,a\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________